
import unittest as ut
from ... import DataString as ds

class AcpTestCase(ut.TestCase):
    def setUp(self):
        self.section_line="************************************************************"
        self.show_enable=1


    def _Parse(self, msg):
        pass

    def _GetSubItem(self, item, subName='', ssubName=''):
        if subName in item._subList:
            subItem = item._subList[subName]

            if ssubName in subItem._subList:
                ssubItem = subItem._subList[ssubName]
                #reutn subItem of the subItem
                return ssubItem
            else:
                #return subItem
                return subItem
        else:
            #no sub item, so return the item that passed in
            return item

    def _Show(self, item):
        if self.show_enable:
            print "\n" + self.section_line
            print item.FormDisplayString()

